package com.jt.config;

import com.jt.listener.DemoListener;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;

/**
 * 在这里配置javaee规范中的三大组件
 */
@Configurable
public class ComponentConfig {
    //注册监听器
    @Bean
    public ServletListenerRegistrationBean servletListenerRegistrationBean(){
        ServletListenerRegistrationBean bean = new ServletListenerRegistrationBean(new DemoListener());
        return bean;
    }
}
